/**
 * 
 */
package cn.x.kindergarten.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.x.kindergarten.domain.Child;
import cn.x.kindergarten.service.ChildService;

/**
 * @author Xu Hang @ 2014年12月11日 下午4:28:31
 *
 */

@Controller("mainController")
@RequestMapping("/main")
public class Main {
	@Autowired
	public ChildService childService;
	
	@RequestMapping("/index.action")
	public String index(Model model){
		List<Child> childList = this.childService.queryAll();
		model.addAttribute("childList", childList);
		return "listChildren";
	}
}

